package com.gitee.wsl.text.dfa

import kotlin.test.Test
import kotlin.test.assertEquals


class SensitiveUtilTest {
//    @Test
//    fun testSensitiveFilter() {
//        val wordList = ArrayList<String>()
//        wordList.add("大")
//        wordList.add("大土豆")
//        wordList.add("土豆")
//        wordList.add("刚出锅")
//        wordList.add("出锅")
//        var bean: TestBean = TestBean()
//        bean.setStr("我有一颗$大土^豆，刚出锅的")
//        bean.setNum(100)
//        SensitiveUtil.init(wordList)
//        bean = SensitiveUtil.sensitiveFilter(bean, true, null)
//        assertEquals(bean.getStr(), "我有一颗$****，***的")
//    }


    @Test
    fun issue2126() {
        SensitiveUtil.init(listOf("赵", "赵阿", "赵阿三"))

        val result: String? = SensitiveUtil.sensitiveFilter("赵阿三在做什么。", true)
        assertEquals("***在做什么。", result)
    }
}
